package cn.good.yan.controller;

import cn.good.yan.apis.PayFeignApi;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * 订单 - 演示：链路跟踪
 * 演示：
 * 启动 cloud-order、cloud-provider-payment 服务
 *  1. 启动 java -jar zipkin-server-3.3.0-exec.jar
 *  2. 访问 http://localhost:9411/zipkin/
 *  3. 请求服务端 http://localhost:8001/m/test/1  接口没问题
 *  4. 请求客户端 http://localhost/feign/mm/1
 *  5. 查看zipkin管理页面，查看链路跟踪情况
 *
 * @author shengren.yan
 * @create 2022-04-06
 */
@RestController
@Slf4j
public class MicrometerController {

    @Resource
    private PayFeignApi payFeignApi;

    @GetMapping(value = "/feign/mm/{id}")
    public String myMicrometer(@PathVariable("id") Integer id) {
        return payFeignApi.myMicrometer(id);
    }

}